<template>
  <div class="wrap">
    <el-container>
      <el-header>关于融惠通</el-header>
      <el-container>
        <el-aside width="80px">
          <div class="left">
            <span  @click="toapplyfor">申請</span>
            <span>列表</span>
            <span>xxx</span>
          </div>
        </el-aside>
        <el-main>
          <el-table :data="tableData" style="width: 100%">
            <el-table-column prop="userName" label="用户名" width="200"></el-table-column>
            <el-table-column prop="scanTime" label="日期" width="200"></el-table-column>
            <el-table-column prop="authenticationId" label="authenticationId" width="200"></el-table-column>
            <el-table-column prop="userId" label="userId" width="200"></el-table-column>
             <el-table-column prop="id" label="id"></el-table-column>
          id
          </el-table>
          <div class="block">
            <el-pagination
              @size-change="handleSizeChange"
              @current-change="handleCurrentChange"
              :current-page="currentPage"
              :page-sizes="[5, 10, 15, 20]"
              :page-size="100"
              layout="total, sizes, prev, pager, next, jumper"
              :total="200"
            ></el-pagination>
          </div>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>
<script>
export default {
  data() {
    return {
      currentPage: 4,
      tableData:[]
    };
  },
  created(){
      let userId = localStorage.getItem('xxid')
      this.$api.list({
            pageSize: 1,  //一頁展示多少
            pageNumber: 1,
            id:"808af0c86adfbe7cd08248bffd52ce23"
        })
        .then((value) => {
          console.log(value);
          this.tableData = value.data
        });
  },
  methods: {
    handleSizeChange(val) {
      console.log(`每页 ${val} 条`);
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`);
    },
    
     toapplyfor() {
    this.$router.push({ path: 'applyfor', query: { id: '0' } });
  }
  }
};
</script>
<style>
.el-header,
.el-footer {
  background-color: #b3c0d1;
  color: #333;
  text-align: center;
  line-height: 60px;
}

.el-aside {
  background-color: #d3dce6;
  color: #333;
  text-align: center;
  line-height: 200px;
  line-height: 31vh;
}

.el-main {
  background-color: #e9eef3;
  color: #333;
  text-align: center;
  line-height: 160px;
}

body > .el-container {
  margin-bottom: 40px;
}

.el-container:nth-child(5) .el-aside,
.el-container:nth-child(6) .el-aside {
  line-height: 260px;
}

.el-container:nth-child(7) .el-aside {
  line-height: 320px;
}
.left span {
  height: 80%;
  display: flex;
  flex-direction: column;
  border: 1px solid #eee;
}

</style>